home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
database
/
do1beta
/
factor.do
< prev
next >
Wrap
Text File
|
1991-07-18
|
284b
|
18 lines
/*
define a recursive factorial method for the "Long" class
*/
method Long::factorial(self)
{
if(self <= 1L) return(self);
else return(self*factorial(self-1L));
}
/*
calculate some factorials
*/
i = 0;
while(i < 10) {
? i," ",factorial(asLong(i));
i = i+1;
}